package com.nbjtjc.safe.mapper.danger;

import com.nbjtjc.safe.model.danger.DangerInspect;
import com.nbjtjc.safe.model.danger.SafeDangerInspectLabel;
import com.nbjtjc.safe.model.know.SafeKnowLabel;
import com.nbjtjc.util.MyMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SafeDangerInspectLabelMapper extends MyMapper<SafeDangerInspectLabel> {

    @Delete("delete from safe_danger_inspect_label where inspect_id=#{inspectId}")
    int deleteByInspectId(@Param("inspectId") int inspectId);

    List<SafeDangerInspectLabel> search(@Param("sdl") SafeDangerInspectLabel safeDangerInspectLabel
    ,@Param("inspectIds") List<Integer> inspectIds);

    @Select("select * from safe_danger_inspect_label where inspect_id=#{inspectId}")
    List<SafeDangerInspectLabel> findByInspectId(@Param("inspectId") int inspectId);

    @Select("select label from safe_danger_inspect_label where inspect_id=#{inspectId}")
    List<String> findLabelByInspectId(@Param("inspectId") int inspectId);
    @Select("select inspect_id from safe_danger_inspect_label where label=#{label}")
    List<Integer> inspectIdsByLabel(@Param("label") String label);
    List<SafeDangerInspectLabel> topLabel(@Param("inspectIds") List<Integer> inspectIds);
}